package com.maychat.mapper;

import com.maychat.pojo.CustomUserIdInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CustomUserIdInfoMapper {

    @Insert("insert into custom_user_id_info (email, target_user_id) values (#{email}, #{targetUserId})")
    void insert(CustomUserIdInfo customUserIdInfo);

    @Select("select * from custom_user_id_info where email = #{email} ")
    CustomUserIdInfo getByEmail(String email);

    @Select("select * from custom_user_id_info where email = #{email} and status = 0")
    CustomUserIdInfo getByEmailStatus0(String email);

    @Select("select * from custom_user_id_info where id = #{id} ")
    CustomUserIdInfo getById(Integer id);

    @Select("select * from custom_user_id_info where target_user_id = #{targetUserId} ")
    CustomUserIdInfo getByTargetUserId(String targetUserId);

    List<CustomUserIdInfo> selectCond(CustomUserIdInfo custom);

    void updateById(CustomUserIdInfo custom);

    @Delete("delete from custom_user_id_info where id = #{id}")
    void delById(Integer id);
}
